home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / etc / resolvconf / update-libc.d / avahi-daemon
Encoding:
Text File  |  2007-03-27  |  1.4 KB  |  40 lines

  1. #!/bin/sh
  2. #
  3. # If we have an unicast .local domain, we immediately disable avahi to avoid
  4. # conflicts with the multicast IP4LL .local domain
  5. DISABLE_TAG_DIR="/var/run/avahi-daemon/"
  6. DISABLE_TAG="$DISABLE_TAG_DIR/disabled-for-unicast-local"
  7.  
  8. OUT=`LC_ALL=C host -t soa local. 2>&1`
  9.  
  10. if [ $? -eq 0 ] && echo "$OUT" | egrep -vq 'has no|not found'; then
  11.     if [ -x /etc/init.d/avahi-daemon ]; then
  12.         /etc/init.d/avahi-daemon stop || true
  13.         if [ -x /usr/bin/logger ]; then
  14.             logger -p daemon.warning -t avahi <<EOF
  15. Avahi detected that your currently configured local DNS server serves
  16. a domain .local. This is inherently incompatible with Avahi and thus
  17. Avahi disabled itself. If you want to use Avahi in this network, please
  18. contact your administrator and convince him to use a different DNS domain,
  19. since .local should be used exclusively for Zeroconf technology.
  20. For more information, see http://avahi.org/wiki/AvahiAndUnicastDotLocal
  21. EOF
  22.         fi
  23.     fi
  24.     if [ ! -d ${DISABLE_TAG_DIR} ] ; then 
  25.       mkdir -m 0755 -p ${DISABLE_TAG_DIR}
  26.       chown avahi:avahi ${DISABLE_TAG_DIR}
  27.     fi 
  28.     touch ${DISABLE_TAG}
  29. else
  30.     # no unicast .local conflict, so remove the tag and start avahi again
  31.     if [ -e ${DISABLE_TAG} ]; then
  32.         rm -f ${DISABLE_TAG}
  33.         if [ -x /etc/init.d/avahi-daemon ]; then
  34.             /etc/init.d/avahi-daemon start || true
  35.         fi
  36.     fi
  37. fi
  38.  
  39. exit 0
  40.